package com.sk.sourcecircle.dialog;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.TextView;

import com.sk.sourcecircle.R;
import com.sk.sourcecircle.base.BaseDialogFragment;
import com.sk.sourcecircle.callback.MyCallBack;

import butterknife.BindView;
import butterknife.OnClick;
import butterknife.Unbinder;

/**
 * Created by sk on 2018/1/6.
 */

public class TextTipDialogFragment extends BaseDialogFragment {
    @BindView(R.id.tv_tip)
    TextView tvTip;
    @BindView(R.id.sure)
    TextView sure;
    Unbinder unbinder;

    private String content;
    private MyCallBack myCallBack;

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public MyCallBack getMyCallBack() {
        return myCallBack;
    }

    public void setMyCallBack(MyCallBack myCallBack) {
        this.myCallBack = myCallBack;
    }

    @Override
    protected int getContentView() {
        return R.layout.activity_text_tip;
    }

    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        if(content!=null){
            tvTip.setText(content);
        }
    }

    @OnClick(R.id.sure)
    public void onViewClicked() {
        dismiss();
        if(myCallBack!=null){
            myCallBack.sure();
        }

    }
}
